import request from "@/utils/request";
import type { RequestParams, ResponseData, MarkerRequestParams } from "./type";

// 分页列表
export const MarkerList = (data: RequestParams) => {
  return request<ResponseData<MarkerRequestParams>, any>({
    url: "/api/v1/agv/page",
    method: "post",
    data,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
export const optionsList = (data: RequestParams) => {
  return request<ResponseData<MarkerRequestParams>, any>({
    url: "/api/v1/agv/options",
    method: "post",
    data,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
export const addMarker = (data: MarkerRequestParams) => {
  return request<ResponseData<MarkerRequestParams>, any>({
    url: "/api/v1/agv/add",
    method: "post",
    data,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
// export const delMarker = (id: number) => {
//   return request<ResponseData<MarkerRequestParams>, any>({
//     url: "/api/v1/robotMarker/delete",
//     method: "post",
//     data: id,
//     headers: {
//       //需要加密的请求在头部塞入标识
//       isEncrypt: 1,
//     },
//   });
// };
export const FormMarker = (id: number) => {
  return request<ResponseData<MarkerRequestParams>, any>({
    url: "/api/v1/agv/form",
    method: "post",
    data: id,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
export const updateMarker = (id: number) => {
  return request<ResponseData<MarkerRequestParams>, any>({
    url: "/api/v1/agv/update",
    method: "post",
    data: id,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
export const editUserStatus = (data: any) => {
  return request<ResponseData<any>, any>({
    url: "/api/v1/agv/forbidden",
    method: "post",
    data,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
export const LibraryOptions = (aesKeyByRsa: string) => {
  return request<ResponseData<any>, any>({
    url: "/api/v1/library/options",
    method: "post",
    data: aesKeyByRsa,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
